home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Prograph Classic 2.6.1 / Prograph Reference Manual / Prograph Reference 1-4 / Prograph Reference 1-4.rsrc / TEXT_148.txt < prev    next >
Encoding:
Text File  |  1995-10-21  |  4.1 KB  |  120 lines

  1.  
  2. t    Runtime Interruption*120*
  3.  
  4. During execution, two conditions can arise that cause the Prograph interpreter to suspend execution, aside from encountering a Breakpoint or a method with Single Step on.
  5.  
  6. o    The first condition is a reference to a program element that does not exist. Rectifying such an omission requires little user interaction.
  7.  
  8. o    The second condition is an execution error. Fixing this requires more user interaction.
  9.  
  10. Automatic Creation at Runtime*120*
  11.  
  12. An extremely useful feature of the Prograph interpreter is the runtime creation of methods, classes, attributes, and persistents. If an attempt is made to execute an operation for which the associated element does not exist, a dialog is displayed asking whether the element should be created. If the user clicks the OK button on this dialog, the interpreter creates the element. If the user clicks the Cancel button, the interpreter closes the dialog but treats the condition as an error, opening the appropriate execution case window and signalling an error. 
  13.  
  14. Method*120*
  15.  
  16. When the element is a method, the displayed dialog informs the user about the type and name of method that Prograph is attempting to call. For example:*120*
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32. *120*If the user presses the OK button, the interpreter creates a method and opens its first case window with correct arity. Depending on the name of the operation that initiated this interaction, the method created is either universal, or is created in an appropriate class. If the name completely specifies the class, the method is created there. If the operation is data-determined, another dialog opens with a scrolling list containing the class of the incoming instance (selected) and all its ancestor classes. The user then selects the class in which to create the new method.*121*
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44. Attribute*121*
  45.  
  46. If an attempt is made to execute a Get or Set on an attribute that does not exist, the interpreter displays a dialog similar to the one shown above for methods. On clicking the OK button, another dialog opens for choosing whether the new attribute is to be a class attribute or an instance attribute, as follows. If the leftmost input to the operation initiating this interaction is a string, the dialog opens with the radio button Class selected; otherwise the button Instance is initially selected. *121*
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. When the user clicks the OK button, Prograph creates the new instance or class attribute and opens a Value window for the user to set the default or initial value of the attribute, respectively (see chapter 2, ‚ÄúThe Editor Environment‚Äù). The attribute is added as the last attribute of its kind in the class.
  59.  
  60. Persistents *121*
  61.  
  62. If an attempt is made to execute a persistent operation referencing a persistent that does not exist, the interpreter displays a dialog similar to the one shown above for methods. If the user clicks the OK button, Prograph creates the persistent and opens a Value window for the user to set its initial value. *121* 
  63.  
  64. Classes *122*
  65.  
  66. If an attempt is made to execute an instance generator for a nonexistent class, the interpreter displays a dialog similar to that above for methods. If the user clicks the OK button, Prograph creates a new class not connected to any existing class.
  67.  
  68. Errors in Execution*122*
  69.  
  70. When an error occurs during execution, the interpreter suspends the execution, opens the appropriate execution case window, flashes the erroneous operation, beeps, and generates a message describing the error, which is automatically displayed if Error Messages has been checked in the Options‚Ķ dialog (see chapter 2, ‚ÄúThe Editor Environment‚Äù). If the Error Messages option is off, selecting Last Error‚Ķ in the Info menu displays the error message. 
  71.  
  72. Typical errors during execution and their corresponding error dialogs are as follows:
  73.  
  74. o    arrival of values of inappropriate types on terminals. For example, a string arriving at a terminal of the primitive +
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89. o    mismatch of arity (number of inputs or outputs) of an operation with that of the method it calls*122*
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105. o    the activation of a Next Case control in the last case of a method*123*
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.